package com.wzxy.ping.dao.impl;

import java.util.List;
import java.util.Map;

import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Repository;

import com.wzxy.ping.bean.User;
import com.wzxy.ping.dao.UserDao;

@Repository
public class UserDaoImpl extends BaseDao<User> implements UserDao{

	@Override
	public User byAdminAndPassword(Map<String, String> map) {
		StringBuffer hql = new StringBuffer("from User where 1 = 1");
		hql.append(" and userid = '" + map.get("admin") + "'");
		hql.append(" and pwd = '" + map.get("password") + "'");
		List<User> list = list(hql.toString(), null);
		if(list.size()>0){
			return list.get(0);
		}
		return null;
	}

}
